import request from '@/utils/request'

// 查询财务核心-期末结转凭证配置列表
export function listFinCarryoverVoucherConfig(query) {
  return request({
    url: '/carryoverVoucherConfig/finCarryoverVoucherConfig/list',
    method: 'get',
    params: query
  })
}

// 查询财务核心-期末结转凭证配置详细
export function getFinCarryoverVoucherConfig(id) {
  return request({
    url: '/carryoverVoucherConfig/finCarryoverVoucherConfig/' + id,
    method: 'get'
  })
}

// 查询财务核心-期末结转凭证配置详细
export function getByFundAccountIdAndCarryoverRecordId(fundAccountId, carryoverRecordId) {
  return request({
    url: '/carryoverVoucherConfig/finCarryoverVoucherConfig/getByFundAccountIdAndCarryoverRecordId/' + fundAccountId + '/' + carryoverRecordId,
    method: 'get'
  })
}

// 查询财务核心-年末结转凭证校验
export function checkYearRecord(fundAccountId, carryoverRecordYearId, carryoverRecordId) {
  return request({
    url: '/carryoverVoucherConfig/finCarryoverVoucherConfig/checkYearRecord/' + fundAccountId + '/' + carryoverRecordYearId + '/' + carryoverRecordId,
    method: 'get'
  })
}

// 根据账套获取最新的年份（已结转的数据）
export function getYearRecordByFundAccountId(fundAccountId) {
  return request({
    url: '/carryoverVoucherConfig/finCarryoverVoucherConfig/getYearRecordByFundAccountId/' + fundAccountId,
    method: 'get'
  })
}

// 保存财务核心-期末结转凭证配置
export function saveFinCarryoverVoucherConfig(data) {
  return request({
    url: '/carryoverVoucherConfig/finCarryoverVoucherConfig/save',
    method: 'post',
    data: data
  })
}

// 删除财务核心-期末结转凭证配置
export function delFinCarryoverVoucherConfig(id) {
  return request({
    url: '/carryoverVoucherConfig/finCarryoverVoucherConfig/' + id,
    method: 'delete'
  })
}

// 导出财务核心-期末结转凭证配置
export function exportFinCarryoverVoucherConfig(query) {
  return request({
    url: '/carryoverVoucherConfig/finCarryoverVoucherConfig/export',
    method: 'get',
    params: query
  })
}
